package com.dongdongshop.controller;

import com.dongdongshop.pojo.TbContentCategory;
import com.dongdongshop.service.ContentService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {

    @DubboReference
    private ContentService contentService;

    @RequestMapping("index")
    public String index() {

        return "admin/index";
    }

    @RequestMapping("login")
    public String login() {

        return "login";
    }

    @RequestMapping("home")
    public String home() {

        return "admin/home";
    }

    @RequestMapping("goods")
    public String goods(){

        return "admin/goods";
    }

    @RequestMapping("contentCategory")
    public String contentCategory(){

        return "admin/content_category";
    }

    @RequestMapping("content")
    public String content(Model model){
        List<TbContentCategory> list =  contentService.selectContentList();
        model.addAttribute("list",list);
        return "admin/content";
    }
}
